package com.example.lishop.repository

import com.example.lishop.entity.BFileEntity
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query
import org.springframework.transaction.annotation.Transactional
import java.util.*

/**
 * Created on 2021/3/14 18:00
 * @author shuguo
 */
interface FileRepository : JpaRepository<BFileEntity, Int>{
    @Transactional(timeout = 10)
    @Modifying
    @Query("update BFileEntity set sts = '1' where fileId = ?1")
    fun del(fileId: String)

    fun findByFileId(fileId: String):BFileEntity?
}